<template>
  <Modal
    v-model:visible="helper.successModalVisible.value"
    :ok-text="$t('APP.Common.GotIt.Text')"
    @close="helper.acknowledgeSuccessful()"
  >
    <text>{{ $t('Appliance.Settings.FirmwareUpgrade.UpgradeSucess.Dialog.Text') }}</text>
  </Modal>
</template>

<script setup lang="ts">
import Modal from '@/common/modal.vue'
import type { OTAHelper } from '../helpers/types'
import { SuccessModalAcknowledge } from '@/constants/UniEventKeys'

const props = defineProps<{
  helper: OTAHelper
}>()

uni.$on(SuccessModalAcknowledge, () => {
  props.helper.successModalVisible.value = false
})
</script>
